package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;

import jhub.DCProtocol;

public class GetInfoMessage extends DCRawCommand {
    
    private String from;
    private String to;
    
    public GetInfoMessage(String command) throws ParseException {
        super(command);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.GETINFO_FORMAT).parse(command.toString());
        from = o[0].toString();
        to = o[1].toString();
    }
    
    /**
     * @return Returns the from.
     */
    public String getFrom() {
        return from;
    }
    
    /**
     * @param from The from to set.
     */
    public void setFrom(String from) {
        this.from = from;
    }
    
    /**
     * @return Returns the to.
     */
    public String getTo() {
        return to;
    }
    
    /**
     * @param to The to to set.
     */
    public void setTo(String to) {
        this.to = to;
    }
    
}
